﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PasswordChange.aspx.cs"
    Inherits="BySoft.Web.Site.SysManage.PasswordChange" MasterPageFile="~/MastePage/SubEmptyMaster.Master" %>

<asp:Content ContentPlaceHolderID="EmptyMasteCPH" runat="server" ID="cphContent">
    <script language="javascript" type="text/javascript">
        function cleartext() {

            document.getElementById("<%=txtOldPwd.ClientID%>").value = "";
            document.getElementById("<%=txtNewPwd.ClientID%>").value = "";
            document.getElementById("<%=txtComfirmPwd.ClientID%>").value = "";
        }

        function chkPwd() {

            if (document.getElementById("<%=txtOldPwd.ClientID%>").value == "") {
                //ShowAlert("提示信息", "请输入旧密码！");
                alert("请输入旧密码!");
                return false;
            }
            if (document.getElementById("<%=txtNewPwd.ClientID%>").value == "") {
                //ShowAlert("提示信息", "请输入新密码！");
                alert("请输入新密码!");
                return false;
            }
            if (document.getElementById("<%=txtComfirmPwd.ClientID%>").value == "") {
                //ShowAlert("提示信息", "请输入确认密码！");
                alert("请输入确认密码!");
                return false;
            }
            if (document.getElementById("<%=txtComfirmPwd.ClientID%>").value != document.getElementById("<%=txtNewPwd.ClientID%>").value) {
                //ShowAlert("提示信息", "新密码和确认密码不同！");
                alert("新密码和确认密码不同!");
                return false;
            }
            var pwd = document.getElementById("<%=txtNewPwd.ClientID%>").value;

            //            if (pwd.length < 6) {
            //                //ShowAlert("提示信息", "密码长度必须大于等于6位！");
            //                alert("密码长度必须大于等于6位!");
            //                return false;
            //            }
        }
    </script>
    <h1 class="tit">
        系统管理 >> 修改密码</h1>
    <div class="tableStyle2">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th width="40%">
                    <span class="red">*</span>旧密码：
                </th>
                <td>
                    <asp:TextBox Width="40%" ID="txtOldPwd" runat="server" TextMode="Password" MaxLength="15"
                         CssClass="text ui-widget-content ui-corner-all"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th width="40%">
                    <span class="red">*</span>新密码：
                </th>
                <td>
                    <asp:TextBox ID="txtNewPwd" Width="40%" runat="server" TextMode="Password" MaxLength="15"
                         CssClass="text ui-widget-content ui-corner-all"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th width="40%">
                    <span class="red">*</span>确认密码：
                </th>
                <td>
                    <asp:TextBox ID="txtComfirmPwd" Width="40%" runat="server" TextMode="Password" MaxLength="15"
                         CssClass="text ui-widget-content ui-corner-all"></asp:TextBox>
                </td>
            </tr>
        </table>
    </div>
    <div class="controlBar" align="center">
        <table cellpadding="0" cellspacing="0" style="width: 140px; margin: 0 auto;">
            <tr>
                <td>
                    <label class="btnStyleb png_bg">
                        <input type="button" id="btnClear" value="重置" onclick="cleartext()" style="width: 60px;" />
                    </label>
                    <label class="btnStylec png_bg">
                        <asp:Button ID="btnOk" OnClick="btnOk_Click" runat="server" Text="确定" OnClientClick="return chkPwd();"
                            Width="60px" />
                    </label>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
